package org.example.huawei;


import java.util.*;

/**
 * @author: lynn
 * @Descript:
 * @date: 2021/5/9 14:58
 * @version: 1.0
 */
public class Main {
    public static void main(String[] args) {
       /* Scanner in =new Scanner(System.in);
        int len=in.nextInt();
        int[] ints=new int[len];*/

        Scanner sc = new Scanner(System.in);
        String input1=sc.nextLine();
        String input2=sc.nextLine();


        List<Integer> listInput=new ArrayList<>();
        listInput.add(Integer.parseInt(input1));

        for(String st:input2.split(" ")){
            listInput.add(Integer.parseInt(st));
        }

        int len=listInput.size();
        int[] ints=new int[len];

        for (int  i=0;i<len;i++){
            ints[i]=listInput.get(i);
        }
        Node[] nodes=new Node[25];
        for (int i = 0; i <=24 ; i++) {
            Node node=new Node();
            node.setList(new ArrayList<String>());
            nodes[i]=node;
        }
        for (int i = 0; i <len ; i++) {
            int num=ints[i];
            for (int j=24-num;j>0;j--){
                List<String> fromList=nodes[j].getList();
                List<String> toList=nodes[j+num].getList();
                for(String s:fromList){
                    List<Integer> list=StringToList(s);
                    list.add(num);
                    Collections.sort(list);
                    String string=ListToString(list);
                    if (!toList.contains(string)){
                        toList.add(string);
                    }
                }
                nodes[j+num].setList(toList);
            }
            List<String> list=nodes[num].getList();
            Integer integer=num;
            list.add(integer.toString());
            nodes[num].setList(list);

        }
        System.out.println(nodes[23].getList().size()+1);
    }
    private static List<Integer> StringToList(String s){
        List<Integer> strings=new ArrayList<>();
        if (s==null ||s.length()==0){
            return strings;
        }
        String[] split=s.split(",");
        for (String str:split){
            strings.add(new Integer(str));
        }
        return strings;
    }
    private static String ListToString(List<Integer> integers){
        if (integers.size()==0){
            return "";
        }
        StringBuilder stringBuilder=new StringBuilder();
        stringBuilder.append(integers.get(0));
        for (int i = 0; i <integers.size() ; i++) {
            stringBuilder.append(",").append(integers.get(i));
        }
        return stringBuilder.toString();
    }

   private static class  Node{
        private List<String> list;
        public List<String> getList(){
            return list;
        }
        public void setList(List<String> list){
            this.list=list;
        }
    }
}
